package com.yoga.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yoga.dao.ReservationMapper;
import com.yoga.model.Reservation;
import com.yoga.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yan
 * @date 2025/8/17
 */
@Service
public class ReservationServiceImpl implements ReservationService {
    private ReservationMapper reservationMapper;
    @Autowired
    public void setReservationMapper(ReservationMapper reservationMapper) {
        this.reservationMapper = reservationMapper;
    }

    @Override
    public Page<Reservation> findAll(Page<Reservation> page, Reservation reservation) {
        return reservationMapper.findAll(page,reservation);
    }

    @Override
    public int deleteByIds(Integer[] ids) {
        return reservationMapper.deleteByIds(ids);
    }

    @Override
    public boolean add(Reservation reservation) {
        return reservationMapper.insert(reservation) > 0;
    }

    @Override
    public boolean update(Reservation reservation) {
        return reservationMapper.updateById(reservation) > 0;
    }
}
